/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package klasy;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cyga
 */
@Entity
@Table(name = "opis", catalog = "medycyna", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Opis.findAll", query = "SELECT o FROM Opis o"),
    @NamedQuery(name = "Opis.findByOpisId", query = "SELECT o FROM Opis o WHERE o.opisId = :opisId"),
    @NamedQuery(name = "Opis.findByOpis", query = "SELECT o FROM Opis o WHERE o.opis = :opis"),
    @NamedQuery(name = "Opis.findByNazwa", query = "SELECT o FROM Opis o WHERE o.nazwa = :nazwa")})
public class Opis implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "opis_id")
    private Integer opisId;
    @Basic(optional = false)
    @Column(name = "opis")
    private String opis;
    @Basic(optional = false)
    @Column(name = "nazwa")
    private String nazwa;

    public Opis() {
    }

    public Opis(Integer opisId) {
        this.opisId = opisId;
    }

    public Opis(Integer opisId, String opis, String nazwa) {
        this.opisId = opisId;
        this.opis = opis;
        this.nazwa = nazwa;
    }

    public Integer getOpisId() {
        return opisId;
    }

    public void setOpisId(Integer opisId) {
        this.opisId = opisId;
    }

    public String getOpis() {
        return opis;
    }

    public void setOpis(String opis) {
        this.opis = opis;
    }

    public String getNazwa() {
        return nazwa;
    }

    public void setNazwa(String nazwa) {
        this.nazwa = nazwa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (opisId != null ? opisId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Opis)) {
            return false;
        }
        Opis other = (Opis) object;
        if ((this.opisId == null && other.opisId != null) || (this.opisId != null && !this.opisId.equals(other.opisId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "klasy.Opis[ opisId=" + opisId + " ]";
    }

}
